package com.haiyou.dc.netty.constant;

/**
 * redis key
 */
public class RedisConstant {

    /**
     * 最近联系人
     */
    public static final String RECENT_USER_KEY = "recent:user:%s";
    /**
     * 最近消息
     */
    public static final String RECENT_MSG_KEY = "recent:msg:%s_%s";

    //消息ID
    public static final String RECENT_MSG_ID_KEY = "msgId";
    //未读条数
    public static final String RECENT_UNREAD_KEY = "unReadCount";
    //接收者
    public static final String RECENT_RECEIVER_KEY = "receiver";

    public static String getRecentUserKey(String msgId) {
        return String.format(RECENT_USER_KEY, msgId);
    }

    public static String getRecentMsgKey(String user1, String user2) {
        return String.format(RECENT_MSG_KEY, user1, user2);
    }
}
